﻿namespace Beeflys.Generator
{
    static class Extensions
    {
        public static string GetProtocolId(this UMethodInfo method)
        {
            return Md5Util.Build(method.FullName);
        }

        public static string GetReqPackName(this UMethodInfo method)
        {
            var methodArgs = method.GetArgsTypes();
            if (methodArgs == null || methodArgs.Count < 1)
            {
                return String.Empty;
            }

            var protocolId = method.GetProtocolId();
            return "_" + protocolId + "_REQ_PACK";
        }
    }
}
